package com.huarui.area.dao.impl;

import java.util.List;
import java.util.Map;

import org.ewaf.framework.dao.impl.BaseDaoImpl;

import com.huarui.area.dao.IAreaDao;
import com.huarui.area.model.Area;

public class AreaDaoImpl extends BaseDaoImpl implements IAreaDao{
	
	@Override
	@SuppressWarnings("unchecked")
	public List<Area> getAllArea() {
		return this.getSqlMapClientTemplate().queryForList(super.namespace + ".getAll");
	}
	
	@Override
	@SuppressWarnings("unchecked")
	public List<Area> getCitesByProvId(Integer id) {
		return this.getSqlMapClientTemplate().queryForList(super.namespace + ".getCitesByProvId", id);
	}
	
	@Override
	@SuppressWarnings("unchecked")
	public List<Area> getDistsByCityId(Integer id) {
		return this.getSqlMapClientTemplate().queryForList(super.namespace + ".getDistsByCityId", id);
	}

	@Override
	@SuppressWarnings("unchecked")
	public List<Area> getProvs() {
		return this.getSqlMapClientTemplate().queryForList(super.namespace + ".getProvs");
	}
	
	@Override
	public Integer getAreaListCountByComplex(Map<String, Object> paramsMap) {
		return (Integer) this.getSqlMapClientTemplate().queryForObject(super.namespace + ".getAreaListCountByComplex", paramsMap);
	}
	
	@Override
	@SuppressWarnings("unchecked")
	public List<Map<String, Object>> getAreaListByComplex(Map<String, Object> paramsMap) {
		return this.getSqlMapClientTemplate().queryForList(super.namespace + ".getAreaListByComplex", paramsMap);
	}

	@Override
	public Integer getMarketIdByAreaId(Integer id) {
		return (Integer) getSqlMapClientTemplate().queryForObject(namespace+".getMarketIdById", id);
	}
}
